package cn.edu.scau.cmi.chenyipeng.composite.safe;

public class SafeLeaf extends SafeComponent{
	private SafeComponent parent;
	private String name;
	
	public SafeLeaf(String name) {
		this.name = name;
	}
	
	public String doSomething() {
		return "我是安全性组合模式中的叶子节点组件";
	}
	
	public void setParent(SafeComponent parent) {
		this.parent = parent;
	}
	
	@Override
	public SafeComponent getParent() {
		return this.parent;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}
	
	public String toString() {
		return this.getName();
	}
}
